#include "../pch.h"

namespace BFX
{

REFXMLComment::REFXMLComment(const UniString& strComment, REFXMLDocument* pDoc)
	: REFXMLLinkedNode(pDoc)
{
	m_strData = strComment;
}
REFXMLComment::~REFXMLComment()
{
}

// Gets the name of the node.
UniString REFXMLComment::GetName() const
{
	return GetOwnerDocument()->m_strCommentName;
}

// Gets the name of the current node without the namespace prefix.
UniString REFXMLComment::GetLocalName() const
{
	return GetOwnerDocument()->m_strCommentName;
}

// Gets the type of the current node.
XMLNodeType REFXMLComment::GetNodeType() const
{
	return BFX::XMLNodeType_Comment;
}

// Gets or sets the value of the node.
UniString REFXMLComment::GetValue() const
{
	return m_strData;
}
void REFXMLComment::SetValue(const UniString& str)
{
	m_strData = str;
}

// Gets or sets the concatenated values of the node and all its children.
UniString REFXMLComment::GetInnerText() const
{
	return GetValue();
}
void REFXMLComment::SetInnerText(const UniString& str)
{
	SetValue(str);
}

// Saves the node to the specified XmlWriter.
void REFXMLComment::WriteTo(REFXMLWriter* w) const
{
	w->WriteComment(GetValue());
}

// Saves all the children of the node to the specified XmlWriter.
void REFXMLComment::WriteContentTo(REFXMLWriter* w) const
{
	// NOTE: intentionally do nothing
}

}	//	namespace BFX
